All Questions
Tagged with clean-architecturedomain-driven-design
45 questions
0votes
3answers
372views
Repository interfaces returning DTO in clean architecture used by query handlers
Repository interfaces are often defined in the Domain layer. This makes sense for command handlers, which call repository methods and return nothing. But what about query handlers that call repository ...
2votes
2answers
450views
How should I implement data access with jpa to meet Clean Architecture/DDD
For the last few days I'm searching any information about compatibility of JPA and Clean Architecture/DDD. I found next ideas for decoupling application from hibernate. Do not use @ManyToMany or @...
3votes
2answers
570views
What value does the mediator pattern add beyond dependency injection?
Does the mediator pattern add any value beyond dependency injection? I am encountering the mediator pattern for the first time in context of this sample application, which is meant to demonstrate how ...
0votes
0answers
111views
How handle foreign keys in bounded contexts inside a monolith?
in my company we have a Django monolithic application. To be clear, we are not looking into moving to micro-services. For the past few months, I have reading and implementing a DDD architecture inside ...
1vote
2answers
255views
CQRS: Multiple entry points for a single command
I’m trying to follow the Clean Architecture and CQRS within an application that, let’s say, create a product. To achieve this, the application has 3 adapters, one for reading a file, another for ...
0votes
0answers
152views
DDD - Managing Relationships between Domain Aggregates
To understand DDD better, I am trying to create the Domain Layer of an online class application. I have a concept of a Student, Tutor and Session. I thought of having one aggregate called Session and ...
3votes
4answers
1kviews
Is validation part of presentation layer or business logic? [duplicate]
We're working on a new project (backend, API), following the "clean code" and "clean architecture" principles (described in Robert Martin's books), dividing our application into ...
6votes
2answers
3kviews
Where to define the interfaces of the infrastructure in a clean architecture and DDD?
I have been reading about clean architecture and following Domain-Driven Design. In all the examples I have found, the interfaces of the repository are defined in the domain. However, it is in the ...
-1votes
2answers
893views
Best Practice for Integrating Domain Services with Infrastructure Layer in Clean Architecture [closed]
I'm currently implementing clean architecture in my project. My application includes various types of communication protocols (TCP, HTTPS, etc.) implemented in the infrastructure layer. These ...
4votes
2answers
906views
Clean Architecture: Loading data for the domain layer
Let's say my domain has a User Entity that has a many to many relationship with itself representing "Friends" public class User { public int Id; public IEnumerable<User>? ...
0votes
1answer
83views
Communicating unpredicted Failure from Repository implementation to Applicaiton Layer
My application follows Clean Architecture wherein the Application Layer wraps the Domain Layer. I try to adhere to DDD more-so as a "guiding light" than a strict rulebook. Within the Domain ...
2votes
1answer
2kviews
Build a Rust project using Clean architecture and DB transactions in the same DDD bounded context
This is just an example of an (still incomplete) real-world project written in Rust using a clean architecture: https://github.com/frederikhors/rust-clean-architecture-with-db-transactions. Goals My ...
1vote
1answer
2kviews
DDD - How to avoid validation rule duplication
From what I understand of DDD, my entities and value objects should be able to enforce its own invariants, meaning that its constructors will check for nulls, must contains numbers and letters, ...
0votes
2answers
417views
How to restrict the construction of a domain object to an external service?
I have this object RelativeFoo{int relativeCode, Origin relativeTo} And I want to map it to this other object AbsoluteFoo{int absoluteCode} In order to do this, I need to use a service whose ...
0votes
1answer
417views
Domain Modeling / Architecture
I'm experimenting with some projects at the moment and I am stuck trying to decide on the correct approach to this question. Given a simple architecture like this consisting of Domain - (Person and ...